#include "StdAfx.h"
#include "bridge.h"

using namespace $RootNamespace$;

$Implementor$ *$Abstraction$::getImplementor()
{
	return _implementor;
}

void $Abstraction$::setImplementor($Implementor$ *value)
{
	_implementor = value;
}

void $Abstraction$::Operation()
{
	getImplementor()->OperationImp();
}



void $Abstraction$::Test()
{
	$Abstraction$ *abstraction = new $RefinedAbstraction$();

	// Set implementation and call
	abstraction->setImplementor(new ConcreteImplementorA());
	abstraction->Operation();

	// Change implemention and call
	abstraction->setImplementor(new ConcreteImplementorB());
	abstraction->Operation();
}

void $RefinedAbstraction$::Operation()
{
	getImplementor()->OperationImp();
}

void ConcreteImplementorA::OperationImp()
{
	std::cout << "OperationA" << std::endl;
}

void ConcreteImplementorB::OperationImp()
{
	std::cout << "OperationB" << std::endl;
}

